﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Frm_Ci : Form
    {
        private Form1 _form;
        public Frm_Ci(Form1 form)
        {
            InitializeComponent();
            _form = form;
            this.StartPosition = FormStartPosition.CenterScreen;
        }
        public void tianChong(DataSet ds)
        {
            Dgv_Ci.DataSource = ds.Tables[0];//设置dataGridView1控件的数据源
        }

        private void Dgv_Ci_DoubleClick(object sender, EventArgs e)
        {
            //_form.writeBack(Dgv_Ci.CurrentRow.Cells[0].Value.ToString(),sender,e);
            _form.findSpec(Dgv_Ci.CurrentRow.Cells[0].Value.ToString(),sender,e);
        }

        private void Frm_Ci_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (e.CloseReason == CloseReason.UserClosing)//当用户点击窗体右上角X按钮或(Alt + F4)时 发生
            {
                e.Cancel = true;
                this.Visible = false;
            }
        }
    }
}
